import request from '@/utils/request'

// 查询试卷列表
export function listPaper(query) {
  return request({
    url: '/exam/paper/list',
    method: 'get',
    params: query
  })
}

// 查询试卷详细
export function getPaper(examId) {
  return request({
    url: '/exam/paper/' + examId,
    method: 'get'
  })
}

// 新增试卷
export function addPaper(data) {
  return request({
    url: '/exam/paper',
    method: 'post',
    data: data
  })
}

// 修改试卷
export function updatePaper(data) {
  return request({
    url: '/exam/paper',
    method: 'put',
    data: data
  })
}

// 删除试卷
export function delPaper(examId) {
  return request({
    url: '/exam/paper/' + examId,
    method: 'delete'
  })
}

// 查询试卷已绑定题目列表
export function listBindQu(query) {
  return request({
    url: '/exam/paper/list/qu/bind',
    method: 'get',
    params: query
  })
}

// 查询试卷未绑定题目列表
export function listUnBindQu(query) {
  return request({
    url: '/exam/paper/list/qu/unBind',
    method: 'get',
    params: query
  })
}


// 修改试卷题目分数
export function updateQuScore(data) {
  return request({
    url: '/exam/paper/qu/editScore',
    method: 'put',
    data: data
  })
}

// 试卷批量绑定题目
export function addPaperQu(datas) {
  return request({
    url: '/exam/paper/qu',
    method: 'post',
    data: datas
  })
}

// 试卷批量解绑题目
export function removePaperQu(datas) {
  return request({
    url: '/exam/paper/qu',
    method: 'delete',
    data: datas
  })
}

// 查询试卷已绑定用户列表
export function listBindUser(query) {
  return request({
    url: '/exam/paper/list/user/bind',
    method: 'get',
    params: query
  })
}

// 查询试卷未绑定用户列表
export function listUnBindUser(query) {
  return request({
    url: '/exam/paper/list/user/unBind',
    method: 'get',
    params: query
  })
}

// 试卷批量绑定用户
export function addPaperUser(datas) {
  return request({
    url: '/exam/paper/user',
    method: 'post',
    data: datas
  })
}

// 试卷批量解绑用户
export function removePaperUser(datas) {
  return request({
    url: '/exam/paper/user',
    method: 'delete',
    data: datas
  })
}

